import request from '/@/utils/request';

// 查询商品分类列表
export function listType(query?: Object) {
  return request({
    url: '/module/product/type/list',
    method: 'get',
    params: query
  })
}

// 查询商品分类列表
export function listAll(query?: Object) {
  return request({
    url: '/module/product/type/listAll',
    method: 'get',
    params: query
  })
}


// 查询商品分类详细
export function getType(id?: number) {
  return request({
    url: '/module/product/type/' + id,
    method: 'get'
  })
}


// 查询部门下拉树结构
export function treeSelect() {
  return request({
    url: '/module/product/type/treeSelect',
    method: 'get'
  })
}

// 新增商品分类
export function addType(data?: Object) {
  return request({
    url: '/module/product/type',
    method: 'post',
    data: data
  })
}

// 修改商品分类
export function updateType(data?: Object) {
  return request({
    url: '/module/product/type',
    method: 'put',
    data: data
  })
}

// 删除商品分类
export function delType(id?: number) {
  return request({
    url: '/module/product/type/' + id,
    method: 'delete'
  })
}

// 导出商品分类
export function exportType(query?: Object) {
  return request({
    url: '/module/product/type/export',
    method: 'get',
    params: query
  })
}
